//创蓝智能短信接口

import axios from "axios";
const account="N1942268";
// API密码
const password="5pAQu7Cba5c63e";
//接口域名
const sms_host = 'https://smssh1.253.com/msg/v1/send/json'; 

async function sendSms(phone,code){
    let msg = `【前程通】您的验证码是${code}。如非本人操作，请忽略。`;
    let data={
        account:account,
        password:password,
        phone:phone,
        msg:msg,
        report:false
    }
    try {
        let res = await axios.post(sms_host,data);
        if(res.data.code != 0){
            console.log('短信发送失败',JSON.stringify(res.data) ,`入参：`,JSON.stringify(data));
            return false;
        }
        return true;
    } catch (error) {
        console.log(error);
        return false;
    }
}
export {sendSms}
// sendSms('18971266199',"5678")





